/**
 * Copyright &copy; 2016-2017 <a href="https://www.lczyfz.com">联创智云</a> All rights reserved.
 */
package com.lczyfz.campusinfo.modules.campusinfophone.web;

import com.lczyfz.campusinfo.common.persistence.Page;
import com.lczyfz.campusinfo.common.utils.ApiResultUtils;
import com.lczyfz.campusinfo.common.web.BaseController;
import com.lczyfz.campusinfo.modules.campusinfophone.entity.CampusinfoPhone;
import com.lczyfz.campusinfo.modules.campusinfophone.service.CampusinfoPhoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 校园通知Controller
 * @author zms
 * @version 2018-03-23
 */
@Controller
@RequestMapping(value = "/api/phone/message")
public class phoneapiController extends BaseController {
	@Autowired
	private CampusinfoPhoneService campusinfoPhoneService;
	@RequestMapping(value = "get")
	@ResponseBody
	public Map<String, Object> getNotice(CampusinfoPhone campusinfoPhone, HttpServletRequest request, HttpServletResponse response) {
		Page<CampusinfoPhone> findPage = campusinfoPhoneService.findPage(new Page<CampusinfoPhone>(request, response),  campusinfoPhone);
		Map<String, Object> map = ApiResultUtils.getBaseMapSuccess();
		map.put("page", findPage.getList().get(0));
		return map;
	}

}